/*
 * texception.h
 *
 *  Created on: Jan 24, 2016
 *      Author: root
 */

#ifndef TEXCEPTION_H_
#define TEXCEPTION_H_

#include "../basic/ds.h"

DEFINE_OPERATOR( make_exception            );
DEFINE_OPERATOR( default_exception_handler );
INIT_OPERATORS( exception );

Cell* make_exception(Scheme *sc, const char *code, const char *desc, OperatorFunc handler, Cell* data);
Cell* make_default_exception(Scheme *sc, const char *code, const char *desc);
Cell* make_default_exception_1(Scheme *sc, const char *code, const char *desc, const char *arg1);
Cell* make_default_exception_2(Scheme *sc, const char *code, const char *desc, const char *arg1, const char *arg2);
void init_exception_constants(Scheme *sc);
int eqe(Cell *a, Cell *b);

Cell* E_DIVISION_BY_ZERO;
Cell* E_NOT_A_REAL;
Cell* E_NOT_A_NUMBER;
Cell* E_INVALID_TYPE;

#endif /* TEXCEPTION_H_ */
